<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
<title>打印输出文字</title>
<script type="text/javascript">
	var max=0;
	function keepText() {
		max=keepText.arguments.length;
		for(var i=0; i<max; i++) {
			this[i]=keepText.arguments[i];
		}
	}
	myText = new keepText("heajalsjfoasfjasofjoasdjfoasdfjosadjf");
	var x=0, pos=0;
	var len=myText[0].length;
	function typeText() {
		document.typeForm.typeField.value=myText[x].substring(0, pos)+"_";
		if(pos++==1){
			setTimeout("typeText()", 2000);
			if(++x==max) x=0;
			len=myText[x].length;
		} else {
			setTimeout("typeText()", 300);
		}
	}
</script>
</head>
<body onload="typeText()">
	<h1>打印输出文字</h1><hr>
	<p>页面载入后,显示打字效果</p>
	<form name="typeForm">
		<textarea id="typeField" rows=10 cols=60></textarea>
	</form>
</body>
</html>